home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c
- Path: eso.org!news
- From: Nicolas Devillard <nDevil@eso.org>
- Subject: is getopt() ANSI and portable ?
- X-Nntp-Posting-Host: mc14
- Content-Type: text/plain; charset=us-ascii
- Message-ID: <31512EC7.389F@eso.org>
- Sender: news@eso.org
- Content-Transfer-Encoding: 7bit
- Organization: ESO - European Southern Observatory, Garching by Munich
- Mime-Version: 1.0
- Date: Thu, 21 Mar 1996 11:26:15 +0100
- X-Mailer: Mozilla 2.01 (X11; I; SunOS 5.4 sun4m)
-
- Hello all:
-
- I do not want to reinvent the wheel by creating again my own
- command line parser. I found this getopt() function being part
- of stdlib, but I'd like to know:
-
- 1. If it is part of the ANSI C stdlib ?
- 2. If it is a portable call ? I cannot find it in the POSIX prog guide.
-
- The definition as given by my man page says :
-
- SYNOPSIS
- #include <stdlib.h>
-
- int getopt(int argc, char * const *argv,
- const char *optstring);
-
- extern char *optarg;
- extern int optind, opterr, optopt;
-
- The call is supported by gcc and acc on Sun4, Solaris, HPUX, IBM AIX.
- Thanks for your help,
- Nicolas
-